﻿@model PagedList.IPagedList<MSDAL.Instrumenty>
@using PagedList.Mvc;

@{
    ViewBag.Title = "Index";
    Layout = "~/Views/Shared/_Layout.cshtml";
}

<h2>Index</h2>

<p>
    @Html.ActionLink("Create New", "Create")
</p>
<table class="table">
    <tr>
        <th>
            Nazwa Instrumentu:
        </th>
        <th>
            Domyslna cena dla ucznia:
        </th>
        <th>
            Domyslna stawka dla nauczyciela:
        </th>
        <th>
            Komentarz:
        </th>
        <th></th>
    </tr>

@foreach (var item in Model) {
    <tr>
        <td>
            @Html.DisplayFor(modelItem => item.NazwaInstrumentu)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.DomyslnaCenaDlaUcznia)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.DomyslnaStawkaDlaNauczyciela)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.Komentarz)
        </td>
        <td>
            @Html.ActionLink("Edit", "Edit", new { id=item.IDInstrumentu }) |
            @Html.ActionLink("Details", "Details", new { id=item.IDInstrumentu }) |
            @Html.ActionLink("Delete", "Delete", new { id=item.IDInstrumentu })
        </td>
    </tr>
}

</table>
Page @(Model.PageCount < Model.PageNumber ? 0 : Model.PageNumber) of @Model.PageCount

@Html.PagedListPager(Model, page => Url.Action("Index",
    new { page, sortOrder = ViewBag.CurrentSort, currentFilter = ViewBag.CurrentFilter }))